<h1>Book Trader</h1>
<h2>Books</h2>
<%= flash_notice %>

<div>
  
  <%= link_to h("A"), :controller => "book",:action => "index", :letter => "a" %>
  <%= link_to h("B"), :controller => "book",:action => "index", :letter => "b" %>
  <%= link_to h("C"), :controller => "book",:action => "index", :letter => "c" %>
  <%= link_to h("D"), :controller => "book",:action => "index", :letter => "d" %>
  <%= link_to h("E"), :controller => "book",:action => "index", :letter => "e" %>
  <%= link_to h("F"), :controller => "book",:action => "index", :letter => "f" %>
  <%= link_to h("G"), :controller => "book",:action => "index", :letter => "g" %>
  <%= link_to h("H"), :controller => "book",:action => "index", :letter => "h" %>
  <%= link_to h("I"), :controller => "book",:action => "index", :letter => "i" %>
  <%= link_to h("J"), :controller => "book",:action => "index", :letter => "j" %>
<%= link_to h("K"), :controller => "book",:action => "index", :letter => "k" %>
<%= link_to h("L"), :controller => "book",:action => "index", :letter => "l" %>
<%= link_to h("M"), :controller => "book",:action => "index", :letter => "m" %>
<%= link_to h("N"), :controller => "book",:action => "index", :letter => "n" %>
<%= link_to h("O"), :controller => "book",:action => "index", :letter => "o" %>
<%= link_to h("P"), :controller => "book",:action => "index", :letter => "p" %>
<%= link_to h("Q"), :controller => "book",:action => "index", :letter => "q" %>
<%= link_to h("R"), :controller => "book",:action => "index", :letter => "r" %>
<%= link_to h("S"), :controller => "book",:action => "index", :letter => "s" %>
<%= link_to h("T"), :controller => "book",:action => "index", :letter => "t" %>
<%= link_to h("U"), :controller => "book",:action => "index", :letter => "u" %>
<%= link_to h("V"), :controller => "book",:action => "index", :letter => "v" %>
<%= link_to h("W"), :controller => "book",:action => "index", :letter => "w" %>
<%= link_to h("X"), :controller => "book",:action => "index", :letter => "x" %>
<%= link_to h("Y"), :controller => "book",:action => "index", :letter => "y" %>
<%= link_to h("Z"), :controller => "book",:action => "index", :letter => "z" %>




</div>

<div>
  Books Indexed by Title
 <ul>
  <% for book in @index_books %>
    <li> <%=  link_to h(book.title), :controller => "book", :action => "show", :letter => "a",:id =>book.id
# link_to h(book.title), :controller => "book", :action => "show", :id => book.id
%></li>
    <% end %>
</ul>
</div>



  



<%  #Somewhere here I will have to see if they are authenticated %>
<div>
  <% form_tag({:action => 'index'},:method => 'get') do %>

<%= text_field_tag :search, params[:search] %><br>
<%= submit_tag "Search", :title => nil %>

<% end %>
</div>

Your Search was <%= h @search %>

<div>
  <% for book in @books %>
    <li><%= link_to h(book.title), :action => "show", :id => book.id %> </li>
    <% end %>
  
</div>


